/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.netbeans.shapesimple.palette;


import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;


/**
 *
 * @author rejun001
 */
public class Shape2
{
    
    private String title;
    public static final String PROP_TITLE = "title";
    private int number;
    public static final String PROP_NUMBER = "number";
    private String category;
    public static final String PROP_CATEGORY = "category";
    private String image;
    public static final String PROP_IMAGE = "image";


    public Shape2( String title , int number , String category , String image )
    {
        this.title = title;
        this.number = number;
        this.category = category;
        this.image = image;
    }


    /**
     * Get the value of image
     *
     * @return the value of image
     */
    public String getImage()
    {
        return image;
    }


    /**
     * Set the value of image
     *
     * @param image new value of image
     */
    public void setImage( String image )
    {
        String oldImage = this.image;
        this.image = image;
        propertyChangeSupport.firePropertyChange( PROP_IMAGE , oldImage , image );
    }


    /**
     * Get the value of category
     *
     * @return the value of category
     */
    public String getCategory()
    {
        return category;
    }


    /**
     * Set the value of category
     *
     * @param category new value of category
     */
    public void setCategory( String category )
    {
        String oldCategory = this.category;
        this.category = category;
        propertyChangeSupport.firePropertyChange( PROP_CATEGORY , oldCategory , category );
    }


    /**
     * Get the value of number
     *
     * @return the value of number
     */
    public int getNumber()
    {
        return number;
    }


    /**
     * Set the value of number
     *
     * @param number new value of number
     */
    public void setNumber( int number )
    {
        int oldNumber = this.number;
        this.number = number;
        propertyChangeSupport.firePropertyChange( PROP_NUMBER , oldNumber , number );
    }


    /**
     * Get the value of title
     *
     * @return the value of title
     */
    public String getTitle()
    {
        return title;
    }


    /**
     * Set the value of title
     *
     * @param title new value of title
     */
    public void setTitle( String title )
    {
        String oldTitle = this.title;
        this.title = title;
        propertyChangeSupport.firePropertyChange( PROP_TITLE , oldTitle , title );
    }

    private transient final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this );


    /**
     * Add PropertyChangeListener.
     *
     * @param listener
     */
    public void addPropertyChangeListener( PropertyChangeListener listener )
    {
        propertyChangeSupport.addPropertyChangeListener( listener );
    }


    /**
     * Remove PropertyChangeListener.
     *
     * @param listener
     */
    public void removePropertyChangeListener( PropertyChangeListener listener )
    {
        propertyChangeSupport.removePropertyChangeListener( listener );
    }

}
